-- GENERATED SPELL FOR [Necrotech] --


function spell0_24540(pUnit, Event) --@Curse of Weakness,n/a--
pUnit:FullCastSpellOnTarget(18267,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24540', 30345, 1)
end

function spell1_24540(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(17173,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_24540', 5000, 1)
end

function spell2_24540(pUnit, Event) --@Mind Control,n/a--
pUnit:FullCastSpellOnTarget(43871,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24540', 3284, 1)
end

function spell3_24540(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24540', 3000, 1)
end

function Sorts_24540(pUnit, Event)
local choix_sorts_24540 = math.random(0, 3)
if choix_sorts_24540 == 0 then
pUnit:RegisterEvent('spell0_24540', 1, 1)
end
if choix_sorts_24540 == 1 then
pUnit:RegisterEvent('spell1_24540', 1, 1)
end
if choix_sorts_24540 == 2 then
pUnit:RegisterEvent('spell2_24540', 1, 1)
end
if choix_sorts_24540 == 3 then
pUnit:RegisterEvent('spell3_24540', 1, 1)
end
end

function mob24540_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24540', math.random(1500, 3000), 1)
end

function mob24540_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24540_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24540_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24540, 1, 'mob24540_Action')
RegisterUnitEvent(24540, 2, 'mob24540_Leave')
RegisterUnitEvent(24540, 3, 'mob24540_Kill')
RegisterUnitEvent(24540, 4, 'mob24540_Die')
